package itasura.singleton.lazy;

/**
 * 懒汉模式，线程安全
 * @author sailor wang
 * @date 2020/6/30 5:10 PM
 * @description
 */
public class SingletonSafe {
    private static SingletonSafe instance;

    private SingletonSafe(){}

    private static synchronized SingletonSafe getInstance(){
        if (instance == null){
            instance = new SingletonSafe();
        }
        return instance;
    }
}